package com.cuijq.idempotent.v2;

/**
 * @author by CuiJQ
 * @Classname Idempotence
 * @Description Idempotence Description
 * @Date 2021/6/1 11:51
 */
public class Idempotence {

  private IdempotenceStorage storage;

  public Idempotence(IdempotenceStorage storage) {
    this.storage = storage;
  }

  public boolean saveIfAbsent(String idempotenceId) {
    return storage.saveIfAbsent(idempotenceId);
  }

  public void delete(String idempotenceId) {
    storage.delete(idempotenceId);
  }
}
